<?php
require_once "../Common/database.php";
require_once "../Common/values.php";
require_once "../Common/theme.php";
echo'<script language=javascript>
function runApp(par,ask)
{
if (ask == "true"){
    var answer = confirm("Do you want to run : " + "" + par +"")
	if (answer){
		var shell = new ActiveXObject("WScript.shell");
        shell.run(par, 1,1);
	}
	else{

	}

	}
	else{
		var shell = new ActiveXObject("WScript.shell");
        shell.run(par, 1,1);
	}
}
</script>';
echo'<table>';

if($_GET[f]=='')
{
$_GET[f]='Common';
$_POST[folder]='Common';
}

if($_POST[folder]=='All')
{
$_GET[f]='%';
}
if($_POST[folder]=="")
{
$_POST[folder]='All';
}

echo '<form target="_self" action="menuex.php?f='.$_GET[f].'" method="POST"><table border=0>';
echo '<tr><td><select name="folder" onchange="this.form.submit();"><option>'.$_POST[folder].'</option><option></option>';
genLinks();
echo '</select></td></tr></table></form>';
echo '<table border=0>';
#echo '<tr><td>Name</td></tr>';
if($_POST[folder]=="All")
{
$_POST[folder]='%';
}
$_GET[f]=$_POST[folder];

$result = mysql_query("SELECT * FROM tblLinks WHERE Folder LIKE '$_POST[folder]'");
while($row = mysql_fetch_array($result))
  {
echo '<tr><td class="noborder"><a href='.$row['Link'].' >'.$row['Name'].'</a><p><p></td></tr>';
  }
echo '</table>';

?>
